package fileFinder;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class FileImporter {


	private List<File> listOfFiles = new ArrayList<File>();

	public List<File> scanForFiles(String sciezka) {
		listOfFiles.clear();
		scanForFiles(new File(sciezka));
		return listOfFiles;
	}

	private void scanForFiles(File file) {
		if (!file.isDirectory()) {
			listOfFiles.add(file.getAbsoluteFile());
			return;
		}

		for (int i = 0; i < file.listFiles().length; i++) {
			File currentFile = file.listFiles()[i];
			scanForFiles(currentFile);
		}
	}

}
